package com.sihan.framework.etm.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.framework.model.BaseModel;
import com.framework.mybatis.annotation.AutoGenerator;
import com.framework.mybatis.enums.IdType;

import java.io.Serializable;

import javax.persistence.*;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * 单位表
 */
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Table(name = "jdx_org")
public class Org extends BaseModel implements Serializable {

	private static final long serialVersionUID = 1L;

	/**
	 * 权限ID
	 */
	@Id
	@Column(name = "ID")
	@GeneratedValue(strategy = GenerationType.AUTO)
	@AutoGenerator(idType = IdType.UUID32)
	private String id;

	/**
	 * 父类单位ID
	 */
	private String parentId;

	private String code;

	/**
	 * 单位名称
	 */
	private String name;

	/**
	 * 是否是部门0:否1:是
	 */
	private Short isDep;

	private Short sort;

	/**
	 * 部门负责人
	 */
	private String leadUser;
	/**
	 * 部门负责人电话
	 */
	private String phone;

	/**
	 * 公司编号
	 */
	private String companyCode;

	/**
	 * 部门编号
	 */
	private String depCode;

	/**
	 * 单位地址
	 */
	private String address;

	/**
	 * 公司简介
	 */
	private String remarks;

	@JsonIgnore
	private Boolean isDelete;

	public Org(Boolean isDelete) {
		this.isDelete = isDelete;
	}

	public Org(String companyCode, Boolean isDelete, Short isDep) {
		this.companyCode = companyCode;
		this.isDelete = isDelete;
		this.isDep = isDep;
	}
}
